<?php
require_once("Connections/local.php"); // database connection

	// Retrieve data from Query String
$cur = $_GET['cur'];

if ($cur == 'All') {
	// all prod query
	$query = "SELECT title, trn, cert_complete FROM legacy_products WHERE legacy_products.delivery = 'ILT' AND legacy_products.status IN ( 'Active', 'Under development') AND legacy_products.content_source = 'STD'";
} else {
	//curriculum query
	$query = "SELECT title, trn, cert_complete FROM legacy_products WHERE legacy_products.delivery = 'ILT' AND legacy_products.status IN ( 'Active', 'Under development') AND legacy_products.content_source = 'STD' AND legacy_products.curriculum LIKE '" . $cur ."'";
}

$result 		= @mysql_query($query); 
$row_courses 	= mysql_fetch_assoc($result);



/////////////////////////////////////////////////
 do { 
         echo '<div class="content_data"><p class="title">' . $row_courses['trn'] . ' - ' .  $row_courses['title'] ; 
		 echo '</p><div class="cert_date">' ;
		   if ($row_courses['cert_complete'] != '') { 
					echo '<img src="images/completeButton.png"/>' ;
				} 
          echo '</div></div>' ;
 } while ($row_courses = mysql_fetch_assoc($result));
 
 ?>